package main

import (
	"encoding/json"
	"fmt"
	"github.com/astaxie/beego/httplib"
	"io/ioutil"
	"strconv"
)

func main(){
	url:="https://service-4pvwx5e4-1251434793.gz.apigw.tencentcs.com/test/red_pack/account/"
	for i:=0; i<1;i++  {
		req:=httplib.Post(url)
		req.Header("Authorization","Basic Y2xpZW50OnNlY3JldA==")
		auth := make(map[string]string)
		auth["password"]="123456"
		aa := strconv.Itoa(i)
		auth["userName"]="151082809"+aa
		req.Body(auth)
		rsp,err:=req.Response()
		if err!=nil {
			fmt.Println(err)
		}else{
			rrrr := make(map[string]string)
			data, _ := ioutil.ReadAll(rsp.Body)
			json.Unmarshal(data,rrrr)
			fmt.Println(string(data))
		}
	}

}
